package com.car.service.impl;

import com.car.mapper.SysUserMapper;
import com.car.pojo.SysUser;
import com.car.service.SysUserMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SysUserMapperServiceImpl implements SysUserMapperService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public List<SysUser> list(SysUser sysUser, Integer pageSize, Integer pageNo) {
        Integer startIndex = (pageNo-1) * pageSize;
        return sysUserMapper.list(sysUser, startIndex, pageNo);
    }

    @Override
    public Integer selectSysUserCount(SysUser sysUser) {
        return sysUserMapper.selectSysUserCount(sysUser);
    }

    @Override
    public Integer add(SysUser sysUser) {
        return sysUserMapper.add(sysUser);
    }

    @Override
    public int delete(Integer user_id) {
        return sysUserMapper.delete(user_id);
    }

    @Override
    public int update(SysUser sysUser) {
        return sysUserMapper.update(sysUser);
    }

    @Override
    public SysUser getByid(Integer user_id) {
        return sysUserMapper.getByid(user_id);
    }
}
